import * as actionType from './constants.js';
import { reqfinddate } from "../../../api/index"
export const ChangeFindData = (data) => {
    return {
        type: actionType.CHANGE_FIND_DATA,
        data: data
    }
}

// export const getFindData = (id) => {
//     return (dispatch) => {
//         reqfind(id)
//             .then(data => {
//                 dispatch(ChangeFindData(data.data.data))
//             })
//             .catch(error => {
//                 console.log('出错了');
//             })
//     }
// }

export const getFindData = (page) => {
    return (dispatch) => {
        reqfinddate(page)
            .then((res) => {
                console.log(res)
                dispatch(ChangeFindData(res.data.data))
            })
            .catch((e) => {
                console.log('出错了');
            })
    }
}

export const getDetailCreate = (item) => {
    return {
        type: actionType.CHANGE_DETAIL_DATA,
        data: item
    }
}

// export const getDetailDatas = (item) => {
//     return (dispatch) => {
//         dispatch()
//     }
// }